<template>
  <div class="list-table">
    <div class="area-header">
      <span class="area-header-title">{{ $t('投资收益情况(个人)') }}</span>
    </div>
    <el-row v-loading="loading" :gutter="10">
      <el-table :data="list" tooltip-effect="darkTable" border>
        <el-table-column :label="$t('序号')" type="index" align="center" show-overflow-tooltip width="50">
          <template slot-scope="scope">
            {{ (queryParams.pageNum - 1) * queryParams.pageSize + scope.$index + 1 }}
          </template>
        </el-table-column>
        <el-table-column :label="$t('项目名称')" show-overflow-tooltip align="center" prop="dealName" min-width="180">
          <template slot-scope="scope">
            <router-link
              target="_blank"
              :to="{path:'/deal/home/dealBaseHome', query: scope.row.dealType === 'bf' ? { id: scope.row.dealId, companyId: scope.row.companyId, dealType: scope.row.dealType, gpId: scope.row.gpId } : { id: scope.row.dealId, companyId: scope.row.companyId, dealType: scope.row.dealType }}"
              class="link_a"
            >{{ scope.row.dealName }}</router-link>
          </template>
        </el-table-column>
        <el-table-column :label="$t('标的公司名称')" show-overflow-tooltip align="center" prop="companyName" min-width="180">
          <template slot-scope="scope">
            <router-link
              target="_blank"
              :to="{path:'/company/base/companyBaseHome',query:{companyId:scope.row.companyId}}"
              class="link_a"
            >{{ scope.row.companyName }}</router-link>
          </template>
        </el-table-column>
        <el-table-column :label="$t('项目负责人')" align="center" prop="personChargeName" show-overflow-tooltip width="120" />
        <el-table-column :label="$t('累计投资规模') + $t('金额单位')" align="center" prop="investTotal" width="140" show-overflow-tooltip>
          <template slot-scope="scope">
            <span class="money-text">{{ moneyFormat(scope.row.investTotal, 'w') }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('累计回款规模') + $t('金额单位')" align="center" prop="hktotal" width="140" show-overflow-tooltip>
          <template slot-scope="scope">
            <span class="money-text">{{ moneyFormat(scope.row.hktotal, 'w') }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('最新估值') + $t('金额单位')" align="center" prop="gz" width="140" show-overflow-tooltip>
          <template slot-scope="scope">
            <span class="money-text">{{ moneyFormat(scope.row.gz, 'w') }}</span>
          </template>
        </el-table-column>
        <el-table-column :label="$t('汇报倍数') + $t('金额单位')" align="center" prop="hb" width="140" show-overflow-tooltip>
          <template slot-scope="scope">
            <span class="money-text">{{ scope.row.hb }}</span>
          </template>
        </el-table-column>
      </el-table>
    </el-row>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      @pagination="getList"
    />
  </div>
</template>

<script>
import { dealInvestDetail } from '@/api/base/deal/dealBase'
export default {
  components: {
  },
  props: {
    countType: {
      type: String,
      default: undefined
    },
    userId: {
      type: String,
      default: undefined
    },
    year: {
      type: String,
      default: undefined
    }
  },
  data() {
      return {
          list: [],
          loading: false,
          total: 0,
          queryParams: {
            countType: 'fzxm',
            userId: undefined,
            year: undefined,
            pageNum: 1,
            pageSize: 10
          },
          form: {},
          rules: {
          }
      }
  },
  mounted() {
  },
  created() {
  },
  methods: {
    getList() {
      this.loading = true
      this.queryParams.countType = this.countType
      this.queryParams.userId = this.userId
      this.queryParams.year = this.year
      dealInvestDetail(this.queryParams).then(response => {
        this.list = response.rows
        this.total = response.total
        this.loading = false
      })
    },
    // 表单重置
    reset() {
        this.form = {
            id: undefined
        }
        this.resetForm('form')
    },
    /** 搜索按钮操作 */
    queryHandle() {
        this.queryParams.pageNum = 1
        this.getList()
    },
    /** 重置按钮操作 */
    resetQuery() {
        this.resetForm('queryForm')
        this.queryHandle()
    }
  }
}
</script>
